package cn.stylefeng.guns.modular.pay.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


/**
 * 支付交易流水
 * @author allen
 * @date 2021/4/11 17:27
 * @version 1.0
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "pay_transaction")
public class PayTransactionEntity implements Serializable {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 订单ID
     */
    @TableField(value = "order_info_id")
    private Long orderInfoId;

    /**
     * 订单编号
     */
    @TableField(value = "order_no")
    private String orderNo;

    /**
     * 订单总金额
     */
    @TableField(value = "payable_amount")
    private BigDecimal payableAmount;

    /**
     * 用户账号ID
     */
    @TableField(value = "user_account_id")
    private Long userAccountId;

    /**
     * 用户支付账号
     */
    @TableField(value = "user_pay_account")
    private String userPayAccount;

    /**
     * 交易渠道，1：支付宝，2：微信
     */
    @TableField(value = "transaction_channel")
    private Integer transactionChannel;

    /**
     * 交易流水号，第三方支付平台生成
     */
    @TableField(value = "transaction_number")
    private String transactionNumber;

    /**
     * 第三方平台完成支付的时间
     */
    @TableField(value = "finish_pay_time")
    private Date finishPayTime;

    /**
     * 交易渠道返回的状态码
     */
    @TableField(value = "response_code")
    private String responseCode;

    /**
     * 支付状态，1：待支付，2：支付成功，3：支付失败，4：交易关闭；5：退款
     */
    @TableField(value = "`status`")
    private String status;

    /**
     * 创建时间
     */
    @TableField(value = "gmt_create")
    private Date gmtCreate;

    /**
     * 更新时间
     */
    @TableField(value = "gmt_modified")
    private Date gmtModified;

    private static final long serialVersionUID = 1L;

    public static final String COL_ID = "id";

    public static final String COL_ORDER_INFO_ID = "order_info_id";

    public static final String COL_ORDER_NO = "order_no";

    public static final String COL_PAYABLE_AMOUNT = "payable_amount";

    public static final String COL_USER_ACCOUNT_ID = "user_account_id";

    public static final String COL_USER_PAY_ACCOUNT = "user_pay_account";

    public static final String COL_TRANSACTION_CHANNEL = "transaction_channel";

    public static final String COL_TRANSACTION_NUMBER = "transaction_number";

    public static final String COL_FINISH_PAY_TIME = "finish_pay_time";

    public static final String COL_RESPONSE_CODE = "response_code";

    public static final String COL_STATUS = "status";

    public static final String COL_GMT_CREATE = "gmt_create";

    public static final String COL_GMT_MODIFIED = "gmt_modified";
}